<?php
//extract data from the post


//set POST variables
$url = 'http://localhost/gameavatar.net/function/curl_test.php';
$fields = array(
						'lname' => urlencode("Van"),
						'fname' => urlencode("Le Van"),
						'title' => urlencode("Genk"),
						'company' => urlencode("Son Van"),
						'age' => urlencode("75"),
						'email' => urlencode("levanvan1988@gmail.com"),
						'phone' => urlencode("0902358636")
				);

//url-ify the data for the POST
foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
rtrim($fields_string, '&');

//open connection
$ch = curl_init();

//set the url, number of POST vars, POST data
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_POST, count($fields));
curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);

//execute post
$result = curl_exec($ch);
print_r($result);
//close connection
curl_close($ch);

?>